<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }

        html,body{
            width: 100%;
            height: 100%;
        }

        #child{
            position: relative;
        }

        .two {
            width: 200px;
            height: 50px;
            font-size: 20px;
            background-color: aqua;
            border-radius: 20px;
            cursor: pointer;
            position: absolute;
            left: 0;
            top: 0;
        }

        .box{
            width: 100%;
            height: 950px;
            background: rgba(0, 0, 0, 0.2);
            position: relative;
            /* display: none; */
        }

        p{
            width: 500px;
            height: 500px;
            background: #fff;
            position: absolute;
            left: 600px;
            top: 200px;
            /* display: none; */
            position: relative;
        }

        span{
            font-size: 50px;
            text-align: center;
            display: block;
            padding-top: 60px;
            color: aqua;
        }
        .ten {
            width: 200px;
            height: 50px;
            font-size: 20px;
            background-color: aqua;
            border-radius: 20px;
            cursor: pointer;
            position: absolute;
            bottom: 0;
            left: 150px;

        }
    </style>
</head>
<body>
    <div id="root">
        <parse></parse>
    </div>
</body>
</html>

<template id="parse">
<div id="app">
    <div class="box" :state="kaiguan" v-if="kaiguan">
        <p>
            <span>
                菲力宾没有雪<br>
                马尼拉也没有爱<br>
                咚咚咚<br>
                一百个苦咖喱
            </span>
            <button class="ten" @click="handlequeding">确定</button>
        </p>
    </div>
    <child @send="handleSend"></child>
</div>
</template>

<template id="child">
    <button class="two" @click="handleClick">点击有惊喜</button>
</template>

<script src="http://unpkg.zhimg.com/vue@2"></script>
<script>

Vue.component('parse',{
    template: "#parse",
    data(){
        return{
            kaiguan:false
        }
    },
    methods:{
        handleSend(){
            this.kaiguan=!this.kaiguan
        },
        handlequeding(){
            this.kaiguan=!this.kaiguan
        }
    },
    components: {
        child:{
            template:"#child",
            methods:{
                handleClick(){
                    this.$emit('send',777)
                }
            }
        }
    }
})



const vm = new Vue({
    el: "#root",
    data: {
    },
    methods: {
    },
    computed: {
    },
})
</script>